{{csrf_field()}}
<div class="layui-form-item">
    <label for="" class="layui-form-label">所属类别</label>
    <div class="layui-input-inline">
        <select name="category_id" lay-verify="required">
            <option value=""></option>
            @foreach($categorys as $category)
                <option value="{{ $category->id }}" @if(isset($album->category_id)&&$album->category_id==$category->id)selected @endif >{{ $category->name }}</option>
            @endforeach
        </select>
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">所属楼盘</label>
    <div class="layui-input-block">
         <input type="text" value="{{$property->title}}" readonly class="layui-input" style="width:200px;" >
         <input type="hidden" name="property_id" value="{{ $property->id }}">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">上传图片</label>
    <div class="layui-input-block">
        <div class="layui-upload">
            <button type="button" class="layui-btn layui-btn-normal" id="uploadImages"><i class="layui-icon">&#xe67c;</i>选择图片</button>
            <div class="layui-upload-list" >
                <ul id="layui-upload-image-box" class="layui-clear xiangce">
                    @if(isset($album->images) && !$album->images == '')
                        @foreach($album->images as $k=>$m)
                            <li>
                                <img src="{{ $m['smallimg'] }}" /><p>上传成功</p>
                                <input type="hidden" name="images[{{$k}}][bigimg]" value="{{ $m['bigimg'] }}">
                                <input type="hidden" name="images[{{$k}}][smallimg]" value="{{ $m['smallimg'] }}">
                                <span class="layui-icon layui-icon-close-fill close-img" onclick="delImage(this)"></span>
                            </li>
                        @endforeach
                    @endif
                </ul>
                <div class="images-list"></div>
                @if(isset($album->images))
                <input type="hidden" id="imgnum" value="{{count($album->images)}}">
                @else
                <input type="hidden" id="imgnum" value="0">
                @endif
            </div>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">状态</label>
    <div class="layui-input-block">
        <input type="radio" name="status" value="T" title="启用" @if(isset($album->status) && $album->status == 'T') checked @elseif(!isset($album->status)) checked @endif >
        <input type="radio" name="status" value="F" title="禁用" @if(isset($album->status) && $album->status == 'F') checked @endif>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formDemo">确 认</button>
        @if(isset($property) && $property->id>0)
        <a class="layui-btn" href="/admin/album?property_id={{$property->id}}">返回</a>
        @else
        <a class="layui-btn" href="{{route('admin.album')}}" >返 回</a>
        @endif
    </div>
</div>